home *** CD-ROM | disk | FTP | other *** search
/ Aminet 19 / Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso / Aminet / comm / net / ARemote1_00B.lha / ARemote / source / aremote_temp.c < prev    next >
C/C++ Source or Header  |  1997-04-27  |  4KB  |  170 lines

  1. /* This file contains empty template routines that
  2.  * the IDCMP handler will call uppon. Fill out these
  3.  * routines with your code or use them as a reference
  4.  * to create your program.
  5.  */
  6.  
  7. #include "ARemote_temp_aux.h"
  8.  
  9. int ConnectToStringClicked( void )
  10. {
  11.     /* routine when gadget "Connect To" is clicked. */
  12.     winRequests |= FLAG_UPDATE_STATE;
  13.     return 0;
  14. }
  15.  
  16. int AcceptFromStringClicked( void )
  17. {
  18.     /* routine when gadget "Accept From" is clicked. */
  19.     winRequests |= FLAG_UPDATE_STATE;
  20.     winRequests |= FLAG_CHANGE_ACCEPT;
  21.     return 0;
  22. }
  23.  
  24. int ConnectToPortIntClicked( void )
  25. {
  26.     /* routine when gadget "_Port" is clicked. */
  27.     winRequests |= FLAG_UPDATE_STATE;
  28.     return 0;
  29. }
  30.  
  31. int AcceptFromPortIntClicked( void )
  32. {
  33.     /* routine when gadget "Po_rt" is clicked. */
  34.     winRequests |= FLAG_UPDATE_STATE;
  35.     winRequests |= FLAG_CHANGE_ACCEPT;
  36.     return 0;
  37. }
  38.  
  39. int ToggleStringClicked( void )
  40. {
  41.     /* routine when gadget "_Xmit Trigger" is clicked. */
  42.     winRequests |= FLAG_UPDATE_STATE;
  43.     winRequests |= FLAG_CHANGE_TOGGLE;
  44.     return 0;
  45. }
  46.  
  47. int PopupHotkeyStringClicked( void )
  48. {
  49.     /* routine when gadget "Popu_p Hotkey" is clicked. */
  50.     winRequests |= FLAG_UPDATE_STATE;
  51.     winRequests |= FLAG_CHANGE_POPUP;
  52.     return 0;
  53. }
  54.  
  55. int ConnectToPasswordStringClicked( void )
  56. {
  57.     /* routine when gadget "Pas_sword" is clicked. */
  58.     winRequests |= FLAG_UPDATE_STATE;
  59.     return 0;
  60. }
  61.  
  62. int AcceptFromPasswordStringClicked( void )
  63. {
  64.     /* routine when gadget "P_assword" is clicked. */
  65.     winRequests |= FLAG_UPDATE_STATE;
  66.     winRequests |= FLAG_CHANGE_ACCEPT;
  67.     return 0;
  68. }
  69.  
  70. int ConnectOnStartupCheckboxClicked( void )
  71. {
  72.     /* routine when gadget "Co_nnect on Startup" is clicked. */
  73.     winRequests |= FLAG_UPDATE_STATE;
  74.     return 0;
  75. }
  76.  
  77. int ConnectButtonClicked( void )
  78. {
  79.     /* routine when gadget "_Connect Now" is clicked. */
  80.     winRequests |= FLAG_CONNECT;
  81.     return 0;
  82. }
  83.  
  84. int DisconnectButtonClicked( void )
  85. {
  86.     /* routine when gadget "_Disconnect Now" is clicked. */
  87.     winRequests |= FLAG_DISCONNECT;
  88.     return 0;
  89. }
  90.  
  91. int XmitCueCheckboxClicked( void )
  92. {
  93.     /* routine when gadget "Xmi_t Cue" is clicked. */
  94.     winRequests |= FLAG_UPDATE_STATE;
  95.     return 0;
  96. }
  97.  
  98. int ARemoteAbout( void )
  99. {
  100.     /* routine when (sub)item "About" is selected. */
  101.     winRequests |= FLAG_ABOUT;
  102.     return 0;
  103. }
  104.  
  105. int ARemoteEnabled( void )
  106. {
  107.     /* routine when (sub)item "Enable" is selected. */
  108.     if (BEnabled) winRequests |= FLAG_DISABLE;
  109.              else winRequests |= FLAG_ENABLE;
  110.     return 1;
  111. }
  112.  
  113. int ARemoteSaveSettings( void )
  114. {
  115.     /* routine when (sub)item "Save Settings" is selected. */
  116.     winRequests |= FLAG_SAVE_SETTINGS;
  117.     return 0;
  118. }
  119.  
  120. int ARemoteHide( void )
  121. {
  122.     /* routine when (sub)item "Hide" is selected. */
  123.     winRequests |= FLAG_CLOSE_WINDOW;
  124.     return 0;
  125. }
  126.  
  127. int ARemoteQuit( void )
  128. {
  129.     /* routine when (sub)item "Quit" is selected. */
  130.     winRequests |= FLAG_QUIT;
  131.     return 0;
  132. }
  133.  
  134. int ARemoteCloseWindow( void )
  135. {
  136.     /* routine for "IDCMP_CLOSEWINDOW". */
  137.     winRequests |= FLAG_CLOSE_WINDOW;
  138.     return 0;
  139. }
  140.  
  141. int ARemoteVanillaKey( void )
  142. {
  143.   int key = ARemoteMsg.Code;
  144.   
  145.   /* Force to lower case */
  146.   if ((key >= 'A')&&(key <= 'Z')) key += ('a'-'A');
  147.   
  148.   switch(ARemoteMsg.Code)
  149.   {
  150.     case 'o': ActivateGadget(ARemoteGadgets[GD_ConnectToString], ARemoteWnd, NULL); break;
  151.     case 'p': ActivateGadget(ARemoteGadgets[GD_ConnectToPortInt], ARemoteWnd, NULL); break;
  152.     case 's': ActivateGadget(ARemoteGadgets[GD_ConnectToPasswordString], ARemoteWnd, NULL); break;
  153.     case 'a': ActivateGadget(ARemoteGadgets[GD_AcceptFromString], ARemoteWnd, NULL); break;
  154.     case 'r': ActivateGadget(ARemoteGadgets[GD_AcceptFromPortInt], ARemoteWnd, NULL); break;
  155.     case 'w': ActivateGadget(ARemoteGadgets[GD_AcceptFromPasswordString], ARemoteWnd, NULL); break;
  156.     case 'u': ActivateGadget(ARemoteGadgets[GD_PopupHotkeyString], ARemoteWnd, NULL); break;
  157.     case 'x': ActivateGadget(ARemoteGadgets[GD_ToggleString], ARemoteWnd, NULL); break;
  158.     case 'n': GT_SetGadgetAttrs(ARemoteGadgets[GD_ConnectOnStartupCheckbox], ARemoteWnd, NULL, 
  159.               GTCB_Checked, (!((ARemoteGadgets[GD_ConnectOnStartupCheckbox]->Flags)&GFLG_SELECTED)), TAG_END);
  160.               winRequests |= FLAG_UPDATE_STATE;
  161.               break;
  162.     case 'f': GT_SetGadgetAttrs(ARemoteGadgets[GD_XmitCueCheckbox], ARemoteWnd, NULL, 
  163.               GTCB_Checked, (!((ARemoteGadgets[GD_XmitCueCheckbox]->Flags)&GFLG_SELECTED)), TAG_END);
  164.               winRequests |= FLAG_UPDATE_STATE;
  165.               break;
  166.     case 'c': winRequests |= FLAG_CONNECT; break;
  167.     case 'd': winRequests |= FLAG_DISCONNECT; break;
  168.   }
  169.   return 0;
  170. }